const path = require('path')
function resolve(dir) {
    return path.join(__dirname, dir)
}
// vue.config.js
module.exports = {
    /*
      Vue-cli3:
      Crashed when using Webpack `import()` #2463
      https://github.com/vuejs/vue-cli/issues/2463
     */
    // 如果你不需要生产环境的 source map，可以将其设置为 false 以加速生产环境构建。
    publicPath: process.env.NODE_ENV === "production" ? "././" : "/",
    assetsDir: 'static',
    productionSourceMap: false,
    /*
    pages: {
      index: {
        entry: 'src/main.js',
        chunks: ['chunk-vendors', 'chunk-common', 'index']
      }
    },
    */
    configureWebpack: config => {
        //生产环境取消 console.log
        if (process.env.NODE_ENV === 'production') {
            config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
        }
    },
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true,
            }
        }
    },
    devServer: {
        port: 8081,
        proxy: {
            '/system/': {
                // target: 'http://gulou.51kjdata.com/',
                target: 'http://192.168.50.119:8080/',
                // target:'http://192.168.50.23:8080/',
                // targrt: 'http://124.70.221.154:8080/',
                ws: false,
                changeOrigin: true
            },
            
        }
    },
    lintOnSave: undefined
}
